package com.sline.Test;

import java.lang.reflect.Field;

public class Tool {
    public static void setProperty(Object object, String propertyName, Object value) throws Exception {
        Class clazz = object.getClass();
        Field field = clazz.getDeclaredField(propertyName);
        field.setAccessible(true);
        field.set(object, value);
    }
}
